#pragma once
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>

const union PaletteData {
	struct {
		unsigned char r, g, b, a;
	};
	unsigned int data;
};

class AsciiView
{
public:
	AsciiView(const char* AsciiMap = "@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^ `'. ");

	~AsciiView();

	void Render(PaletteData* Palette, int Width, int Height, float scaleWidth, float scaleHeight);

private:
	void ClearLastLine(int lineCnt);

private:
	const char* m_asciiMap;
	int m_asciiMapLen;
	int m_lastLineCnt;
};

